﻿using System.Collections;
using System.Xml.Serialization;
using System.Collections.Specialized;
using System.Collections.Generic;

namespace FreeBroker
{
    public class ChartOptions
    {
        public ChartOptions()
        {
        }

        [XmlAttribute("Number")]
        public int Number;

        [XmlAttribute("WindowWidth")]
        public int WindowWidth;

        [XmlAttribute("WindowHeight")]
        public int WindowHeight;

        [XmlArray("Options"), XmlArrayItem("Option")]
        public ArrayList Options;

        public void SetOptions(List<int> options)
        {
            this.Options = new ArrayList(options.Count);
            foreach (int item in options)
            {
                this.Options.Add(item);
            }
            // Automatically save config
            Config.Save();
        }
    }
}
